package com.share.hope.config;

import com.baidu.aip.imageprocess.AipImageProcess;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class BaiduAiImgConfig {

    public static final String APP_ID = "32921170";
    public static final String API_KEY = "uwbIqGM4Ia5GDGTFEPFYpq61";
    public static final String SECRET_KEY = "mm4Uc4vrsvqz6TuDrDmVhW7CGueIa2IE";

    @Bean
    public AipImageProcess aipImageProcess() {
        // 初始化一个AipImageProcess
        AipImageProcess client = new AipImageProcess(APP_ID, API_KEY, SECRET_KEY);

        // 可选：设置网络连接参数
        client.setConnectionTimeoutInMillis(2000);
        client.setSocketTimeoutInMillis(60000);

        // 可选：设置代理服务器地址, http和socket二选一，或者均不设置
        //        client.setHttpProxy("proxy_host", proxy_port);  // 设置http代理
        //        client.setSocketProxy("proxy_host", proxy_port);  // 设置socket代理
        return client;
    }

}
